package com.osgix.common.pojo.temp;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 用户Bean 继承serializable接口可以在网络中传送
 * @author zqmao
 */
public class User implements Serializable {
	/**
	 * 2009-5-12,下午07:15:52
	 * @author Administrator
	 * @version 2.0
	 *
	 */
	private static final long serialVersionUID = -7044040967145869403L;
	/**
	 * 用户唯一标识
	 */
	private long userID;
	/**
	 * 用户ID
	 */
	private String userAccount = "";
	/**
	 * 用户名
	 */
	private String userName = "";
	/**
	 * 密码
	 */
	private String pass = "";
	/**
	 * 部门ID
	 */
	private String deptID = "";
	/**
	 * 职务
	 */
	private String business = "";
	/**
	 * 邮件
	 */
	private String email = "";
	/**
	 * 电话
	 */
	private String telephone = "";
	/**
	 * 移动电话
	 */
	private String mobile = "";

	/**
	 * 是否允许客户端登录
	 */
	private boolean clientGrant = true;
	/**
	 * 是否允许portal登录
	 */
	private boolean portalGrant = true;

	/**
	 * 密码相关属性，
	 */
	/**
	 * 最后一次密码修改时间
	 */
	private long lastModifyPassTime = 0;
	/**
	 * 密码类型 0 永不过期  1-11111 有效时间 月
	 */
	private long passType = 0;
	/**
	 * 0:不通知/1:邮件/2:短信/4:NMS告警 (可多选,累加) 应用系统是否使用
	 */
	private int notifyType = 0;
	/**
	 * 提前几天通知
	 */
	private int notifyTime = 0;

	/**
	 * 备注
	 */
	private String note = "";

	/**
	 * 拥有角色列表
	 */
	private List roles = new ArrayList();

	/**
	 * 注册时间
	 */
	private long registerDate = 0;
	/**
	 * 创建人
	 */
	private String createMan = "";
	/**
	 * 账号有效期 0永不过期
	 */
	private long effctiveDate = 0;
	/**
	 * 最后登录时间
	 */
	private long lastDate = 0;

	/**
	 * 用户级别，未使用
	 */
	private String level = "";

	/**
	 * 所属部门名称
	 */
	private String deptName = "";

	/**
	 * 构造函数
	 *
	 */
	public User() {

	}

	//zh begin 08.8.7
	/**
	 * 传真
	 *
	 */
	private String fax = "";
	/**
	 * 职务ID，0：员工，1：组长2：处长，3副处长4部长5副部长6其他（来自字典表）
	 */
	private String duty_id = "";
	/**
	 * 职务名称
	 */
	private int duty_value = 0;
	/**
	 * 用户状态 0：正常/1：停用(不允许登录)/2：删除(逻辑删除,删除用户不显示)
	 */
	private int userStatus = 0;
	/**
	 * 最后登陆IP
	 */
	private String lastIp = "";
	/**
	 * 排序  在同一级目录,用户按此顺序排列
	 */
	private int userOrderby = 0;
	/**
	 * 用户类型ID  0：正式，1：临时 (字典表,可增加)
	 */
	private String userType_id = "";
	/**
	 * 是否为系统用户  0:普通用户/ 1:系统内置用户(root)不可删除
	 */
	private int sysUser = 0;

	//zh end 08.8.7    

	//---------用户扩展信息
	/**
	 * 账号
	 */
	//	private String account = "";//
	/**
	 * 头像地址
	 */
	private String portralURI = "";//
	/**
	 * 员工编号
	 */
	private String userCardNum = "";//
	/**
	 * 职称编号  字典
	 */
	private String greadeId = "";//
	/**
	 * 性别  字典
	 */
	private String sex = "";//
	/**
	 * 生日  
	 */
	private long birthday = 0;//
	/**
	 * 民族  字典
	 */
	private String nation = "";//
	/**
	 * 政治面貌  字典
	 */
	private String religion = "";//
	/**
	 * 国家  字典
	 */
	private String country = "";//
	/**
	 * 语言  字典
	 */
	private String language = "";//
	/**
	 * 省份  字典
	 */
	private String province = "";//
	/**
	 * 城市  字典
	 */
	private String city = "";//
	/**
	 * 地址
	 */
	private String addressId = "";//
	/**
	 * 邮编
	 */
	private String postCode = "";//
	/**
	 * 是否允许NMS客户端登陆  与NMS兼容,默认为允许登录,(可通过权限控制是否可登录)
	 */
	//	private int clientGrany = 0;//
	/**
	 * 是否允许uprotal登陆  与uportal兼容
	 */
	//	private int protalGrany = 0;//
	/**
	 * 姓 Portal使用
	 */
	private String suName = "";//
	/**
	 * 名  Portal使用
	 */
	private String firstName = "";//
	/**
	 * 界面风格  Portal使用
	 */
	private String style = "";//
	/**
	 * SOC风格   SOC使用
	 */
	private String socCode = "";//
	/**
	 * 员工等级  Portal使用
	 */
	private String posiLevel = "";
	/**
	 * 用户英文名称  Portal使用
	 */
	private String usrEnglishName = "";
	/**
	 * 活动时间 Portal使用
	 */
	private long activityTime = 0;
	/**
	 * 加入时间  Portal使用
	 */
	private long joinCompDate = 0;
	/**
	 * 离开时间  Portal使用
	 */
	private long quitDate = 0;
	/**
	 * 登陆次数  Portal使用
	 */
	private int loginTimes = 0;
	/**
	 * 登陆IP  Portal使用
	 */
	private long adrIP = 0;
	/**  
	 * 金钱  Portal使用
	 */
	private float myMonery = 0;
	/**
	 * 个性化设置  Portal使用
	 */
	private int individualId = 0;
	/**
	 * 备用属性1
	 */
	private String memo = "";
	/**
	 * 备用实现2
	 */
	private long memoNum = 0;

	private String memo1 = "";
	private String memo2 = "";
	private String memo3 = "";
	private String memo4 = "";
	//---------用户扩展信息 	

	//----------------------用户策略信息
	/**
	 * 账号有效期   0:永不过期/其它：到期日期时间 (只有用户状态为正常时才生效)
	 */
	private long effcitiveTime = 0;

	/**
	 * 认证方式
	 */
	private long certifyType = 0;
	//	private int passType = 0;//密码类型
	//	private int lastModifyPassTime = 0;//最后密码修改时间
	//	private int notifyType = 0;//通知类型
	//	private int notifyTime = 0;//通知时间（提前多少天）
	/**
	 * 找回密码问题  
	 */
	private String question = "";
	/**
	 * 找回密码答案
	 */
	private String answer = "";
	/**
	 * 密码输入错误记录数
	 */
	private int passErredTimes = 0;
	/**
	 * 上次密码错误时间
	 */
	private long passErrorDate = 0;
	/**
	 * 锁定开始时间
	 */
	private long lockDate = 0;
	/**
	 * 锁定天数 
	 */
	private int lockDays = 0;
	/**
	 * 是否锁定(0:正常/1:锁定)
	 */
	private int locked = 0;
	/**
	 * 锁定原因描述
	 */
	private String lockDescription = "";

	//----------------------用户策略信息	    

	/**
	 * 构造函数
	 * @param account 账号
	 */
	public User(String account) {
		this.userAccount = account;
	}

	/**
	 * 深度克隆
	 */
	public Object clone() {
		User newUser = new User();
		newUser.setUserID(userID);
		newUser.setBusiness(business);
		newUser.setClientGrant(clientGrant);
		newUser.setCreateMan(createMan);
		newUser.setDeptID(deptID);
		newUser.setEffctiveDate(effctiveDate);
		newUser.setEmail(email);
		newUser.setLastDate(lastDate);
		newUser.setLastModifyPassTime(lastModifyPassTime);
		newUser.setMobile(mobile);
		newUser.setNote(note);
		newUser.setNotifyTime(notifyTime);
		newUser.setNotifyType(notifyType);
		newUser.setPass(pass);
		newUser.setPassType(passType);
		newUser.setPortalGrant(portalGrant);
		newUser.setRegisterDate(registerDate);
		List newRoles = new ArrayList();
		for (int i = 0; i < roles.size(); i++)
			newRoles.add(roles.get(i));
		newUser.setRoles(newRoles);
		newUser.setTelephone(telephone);
		newUser.setUserAccount(userAccount);
		newUser.setUserName(userName);
		newUser.setLevel(level);
		return newUser;
	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		if (obj == null) {
			if (this == null)
				return true;
			return false;
		} else {
			if (obj instanceof User) {
				if (userAccount != null && userAccount.equals(((User) obj).getUserAccount()))
					return true;
				else
					return false;
			}
			return false;
		}
	}

	/**
	 * 添加一个新的角色
	 * @param roleId
	 */
	public void addRole(String roleId) {
		if (!roles.contains(roleId))
			roles.add(roleId);
	}

	public boolean isClientGrant() {
		return clientGrant;
	}

	public void setClientGrant(boolean clientGrant) {
		this.clientGrant = clientGrant;
	}

	public String getCreateMan() {
		return createMan;
	}

	public void setCreateMan(String createMan) {
		this.createMan = createMan;
	}

	public String getDeptID() {
		return deptID;
	}

	public void setDeptID(String deptID) {
		this.deptID = deptID;
	}

	public long getEffctiveDate() {
		return effctiveDate;
	}

	public void setEffctiveDate(long effctiveDate) {
		this.effctiveDate = effctiveDate;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email == null ? "" : email;
	}

	public long getLastDate() {
		return lastDate;
	}

	public void setLastDate(long lastDate) {
		this.lastDate = lastDate;
	}

	public long getLastModifyPassTime() {
		return lastModifyPassTime;
	}

	public void setLastModifyPassTime(long lastModifyPassTime) {
		this.lastModifyPassTime = lastModifyPassTime;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile == null ? "" : mobile;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public int getNotifyTime() {
		return notifyTime;
	}

	public void setNotifyTime(int notifyTime) {
		this.notifyTime = notifyTime;
	}

	public int getNotifyType() {
		return notifyType;
	}

	public void setNotifyType(int notifyType) {
		this.notifyType = notifyType;
	}

	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}

	public long getPassType() {
		return passType;
	}

	public void setPassType(long passType) {
		this.passType = passType;
	}

	public boolean isPortalGrant() {
		return portalGrant;
	}

	public void setPortalGrant(boolean portalGrant) {
		this.portalGrant = portalGrant;
	}

	public long getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(long registerDate) {
		this.registerDate = registerDate;
	}

	public List getRoles() {
		return roles;
	}

	public void setRoles(List roles) {
		this.roles = roles;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getUserAccount() {
		return userAccount;
	}

	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getBusiness() {
		return business;
	}

	public void setBusiness(String business) {
		this.business = business;
	}

	/**
	 * 
	 */
	public String toString() {
		return userAccount;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public long getUserID() {
		return userID;
	}

	public void setUserID(long userID) {
		this.userID = userID;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public String getDuty_id() {
		return duty_id;
	}

	public void setDuty_id(String duty_id) {
		this.duty_id = duty_id;
	}

	public int getDuty_value() {
		return duty_value;
	}

	public void setDuty_value(int duty_value) {
		this.duty_value = duty_value;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = (fax == null ? "" : fax);
	}

	public String getLastIp() {
		return lastIp;
	}

	public void setLastIp(String lastIp) {
		this.lastIp = lastIp;
	}

	public int getSysUser() {
		return sysUser;
	}

	public void setSysUser(int sysUser) {
		this.sysUser = sysUser;
	}

	public int getUserOrderby() {
		return userOrderby;
	}

	public void setUserOrderby(int userOrderby) {
		this.userOrderby = userOrderby;
	}

	public int getUserStatus() {
		return userStatus;
	}

	public void setUserStatus(int userStatus) {
		this.userStatus = userStatus;
	}

	public String getUserType_id() {
		return userType_id;
	}

	public void setUserType_id(String userType_id) {
		this.userType_id = userType_id;
	}

	public String getAddressId() {
		return addressId;
	}

	public void setAddressId(String addressId) {
		this.addressId = addressId;
	}

	public long getAdrIP() {
		return adrIP;
	}

	public void setAdrIP(long adrIP) {
		this.adrIP = adrIP;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public long getBirthday() {
		return birthday;
	}

	public void setBirthday(long birthday) {
		this.birthday = birthday;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	/*	public int getClientGrany() {
			return clientGrany;
		}

		public void setClientGrany(int clientGrany) {
			this.clientGrany = clientGrany;
		}*/

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public long getEffcitiveTime() {
		return effcitiveTime;
	}

	public void setEffcitiveTime(long effcitiveTime) {
		this.effcitiveTime = effcitiveTime;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getGreadeId() {
		return greadeId;
	}

	public void setGreadeId(String greadeId) {
		this.greadeId = greadeId;
	}

	public int getIndividualId() {
		return individualId;
	}

	public void setIndividualId(int individualId) {
		this.individualId = individualId;
	}

	public String getLanguage() {
		return language;
	}

	public void setLanguage(String language) {
		this.language = language;
	}

	public long getActivityTime() {
		return activityTime;
	}

	public void setActivityTime(long activityTime) {
		this.activityTime = activityTime;
	}

	public long getJoinCompDate() {
		return joinCompDate;
	}

	public void setJoinCompDate(long joinCompDate) {
		this.joinCompDate = joinCompDate;
	}

	public long getLockDate() {
		return lockDate;
	}

	public void setLockDate(long lockDate) {
		this.lockDate = lockDate;
	}

	public float getMyMonery() {
		return myMonery;
	}

	public void setMyMonery(float myMonery) {
		this.myMonery = myMonery;
	}

	public long getPassErrorDate() {
		return passErrorDate;
	}

	public void setPassErrorDate(long passErrorDate) {
		this.passErrorDate = passErrorDate;
	}

	public long getQuitDate() {
		return quitDate;
	}

	public void setQuitDate(long quitDate) {
		this.quitDate = quitDate;
	}

	public int getLockDays() {
		return lockDays;
	}

	public void setLockDays(int lockDays) {
		this.lockDays = lockDays;
	}

	public String getLockDescription() {
		return lockDescription;
	}

	public void setLockDescription(String lockDescription) {
		this.lockDescription = lockDescription;
	}

	public int getLoginTimes() {
		return loginTimes;
	}

	public void setLoginTimes(int loginTimes) {
		this.loginTimes = loginTimes;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public long getMemoNum() {
		return memoNum;
	}

	public void setMemoNum(long memoNum) {
		this.memoNum = memoNum;
	}

	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	public int getPassErredTimes() {
		return passErredTimes;
	}

	public void setPassErredTimes(int passErredTimes) {
		this.passErredTimes = passErredTimes;
	}

	public String getPortralURI() {
		return portralURI;
	}

	public void setPortralURI(String portralURI) {
		this.portralURI = portralURI;
	}

	public String getPosiLevel() {
		return posiLevel;
	}

	public void setPosiLevel(String posiLevel) {
		this.posiLevel = posiLevel;
	}

	/*	public int getProtalGrany() {
			return protalGrany;
		}

		public void setProtalGrany(int protalGrany) {
			this.protalGrany = protalGrany;
		}*/

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public String getReligion() {
		return religion;
	}

	public void setReligion(String religion) {
		this.religion = religion;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getSocCode() {
		return socCode;
	}

	public void setSocCode(String socCode) {
		this.socCode = socCode;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public String getSuName() {
		return suName;
	}

	public void setSuName(String suName) {
		this.suName = suName;
	}

	public String getUserCardNum() {
		return userCardNum;
	}

	public void setUserCardNum(String userCardNum) {
		this.userCardNum = userCardNum;
	}

	public String getUsrEnglishName() {
		return usrEnglishName;
	}

	public void setUsrEnglishName(String usrEnglishName) {
		this.usrEnglishName = usrEnglishName;
	}

	/*	public String getAccount() {
			return account;
		}

		public void setAccount(String account) {
			this.account = account;
		}*/

	public String getPostCode() {
		return postCode;
	}

	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	public int getLocked() {
		return locked;
	}

	public void setLocked(int locked) {
		this.locked = locked;
	}

	public long getCertifyType() {
		return certifyType;
	}

	public void setCertifyType(long certifyType) {
		this.certifyType = certifyType;
	}

	public String getMemo1() {
		return memo1;
	}

	public void setMemo1(String memo1) {
		this.memo1 = memo1;
	}

	public String getMemo2() {
		return memo2;
	}

	public void setMemo2(String memo2) {
		this.memo2 = memo2;
	}

	public String getMemo3() {
		return memo3;
	}

	public void setMemo3(String memo3) {
		this.memo3 = memo3;
	}

	public String getMemo4() {
		return memo4;
	}

	public void setMemo4(String memo4) {
		this.memo4 = memo4;
	}

}
